# !usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Author:张广勤
@Web site: https://www.tunan.wang
@Github:www.github.com

@File:class_list2dict.py
@Time:2022/3/2 10:02

@Motto:不积跬步无以至千里，不积小流无以成江海！
"""
# a=[]
# for i in range(3):
#     a.append(str(i))
# print(a)
#
# b=['a33','b44','c44']
# print(b)
# c=zip(a,b)
# #print(c)
#
# print(dict(c))
# print(len(dict(c)))
# d=dict(c)
# print(type(d))
# print(type(dict(c)))
# print(len(dict(c)))
# print(d)
# dic2={'0': 'a', '1': 'b', '2': 'c'}
# dic1={'0':'a','1':'c','2':'e'}
# print(len(dic1))

class List_dict:

    def __init__(self):
        pass

    def list2dict1(self,list_value):
        list_key = []
        for i in range(len(list_value)):
            list_key.append(i)
        dict = {}
        for i in range(len(list_value)):
            dict[list_key[i]]=list_value[i]

        return dict

    def list2dict2(self,list_value):
        list_key = []
        for i in range(len(list_value)):
            list_key.append('报表'+str(i))
        dict = {}
        for i in range(len(list_value)):
            dict[list_key[i]]=list_value[i]

        return dict

    def list2dict3(self,zq,list_value):
        list_key = []
        for i in range(len(list_value)):
            list_key.append(zq+str(i))
        dict = {}
        for i in range(len(list_value)):
            dict[list_key[i]]=list_value[i]

        return dict

#对象实例化
l2d=List_dict()
list1=[['a','a1'],['b','b1'],['c','c1']]
dict1=l2d.list2dict3('月报',list1)
print(dict1)
print(dict1['月报1'])
#遍历键
for key in dict1.keys():
    print(key)
    #print(dict1[key])

#遍历值
for val in dict1.values():
    print(val)
